home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / Example / IC Resource ƒ / IC Headers ƒ / IC Component API.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-18  |  7.3 KB  |  178 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC Component API.h
  3.     
  4.     Defines the call interface to the IC component.
  5.     
  6.     I (dhn) modified this to appear as a component interface file (IMHO) should
  7.     look like.
  8.     
  9.     I took out the XXXWORDINLINE code, replaced the numerical selector values
  10.     with their enumerated constant values, etc.
  11.     
  12.     By using the ComponentCallNow macro we ensure that the correct expansion
  13.     will take place when compiling 68k or PPC code.  For 68k code, the asm code
  14.     to call the component will expand in place and work correctly.  For PPC code,
  15.     the macro will expand to nothing leaving a prototype for the glue functions.
  16.     
  17.     By using the enumerated values in ICComponentSelectors.h, if the enums change
  18.     then the code will compile to the correct selector routine; it won't be necessary
  19.     to go into this file to change the selector codes.
  20.     
  21.     History:
  22.         11/03/95 - dhn - Modified and renamed to "IC Component API.h"
  23. */
  24.  
  25. /*
  26.     Original header information follows:
  27.     
  28.  * File:         ICCAPI.h
  29.  * Generated by: 1.0d4
  30.  * For:          IC 1.2
  31.  * On:           Monday, 25 September 1995, 19:28:12
  32.  * 
  33.  * This file is part of the Internet Configuration system and
  34.  * is placed in the public domain for the benefit of all.
  35.  */
  36.  
  37. #ifndef __H_IC_Component_API__
  38. #define __H_IC_Component_API__
  39.  
  40. #include <Components.h>
  41.  
  42. #include "IC Types.h"
  43. #include "IC Keys.h"
  44.  
  45. #include "IC Component Selectors.h"
  46.  
  47. #if 0
  48. // routine descriptions
  49. #include "IC Component API Descriptions.h"
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. /* ***** Starting Up and Shutting Down ***** */
  57.  
  58. pascal ICError ICCStart(internetConfigurationComponent* inst,OSType creator);
  59. pascal ICError ICCStop(internetConfigurationComponent inst);
  60.  
  61. pascal ICError ICCStartComponent(internetConfigurationComponent inst,OSType creator) \
  62.     ComponentCallNow(kICCStart,4);
  63. pascal ICError ICCStopComponent(internetConfigurationComponent inst) \
  64.     ComponentCallNow(kICCStop,0);
  65.  
  66. pascal ICError ICCGetComponentInstance(internetConfigurationComponent inst,Ptr* component_inst);
  67.  
  68. /* ***** Specifying a Configuration ***** */
  69.  
  70. pascal ICError ICCFindConfigFile(internetConfigurationComponent inst,short count,ICDirSpecArrayPtr folders) \
  71.     ComponentCallNow(kICCFindConfigFile,6);
  72. pascal ICError ICCFindUserConfigFile(internetConfigurationComponent inst,ICDirSpec* where) \
  73.     ComponentCallNow(kICCFindUserConfigFile,4);
  74. pascal ICError ICCGeneralFindConfigFile(internetConfigurationComponent inst,Boolean search_prefs,Boolean can_create,short count,ICDirSpecArrayPtr folders) \
  75.     ComponentCallNow(kICCGeneralFindConfigFile,10);
  76. pascal ICError ICCChooseConfig(internetConfigurationComponent inst) \
  77.     ComponentCallNow(kICCChooseConfig,0);
  78. pascal ICError ICCChooseNewConfig(internetConfigurationComponent inst) \
  79.     ComponentCallNow(kICCChooseNewConfig,0);
  80. pascal ICError ICCGetConfigName(internetConfigurationComponent inst,Boolean longname,StringPtr name) \
  81.     ComponentCallNow(kICCGetConfigName,6);
  82. pascal ICError ICCGetConfigReference(internetConfigurationComponent inst,ICConfigRefHandle ref) \
  83.     ComponentCallNow(kICCGetConfigReference,4);
  84. pascal ICError ICCSetConfigReference(internetConfigurationComponent inst,ICConfigRefHandle ref,long flags) \
  85.     ComponentCallNow(kICCSetConfigReference,8);
  86. pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst,FSSpec* config) \
  87.     ComponentCallNow(kICCSpecifyConfigFile,4);
  88.  
  89. /* ***** Getting Information ***** */
  90.  
  91. pascal ICError ICCGetSeed(internetConfigurationComponent inst,long* seed) \
  92.     ComponentCallNow(kICCGetSeed,4);
  93. pascal ICError ICCGetPerm(internetConfigurationComponent inst,ICPerm* perm) \
  94.     ComponentCallNow(kICCGetPerm,4);
  95. pascal ICError ICCDefaultFileName(internetConfigurationComponent inst,StringPtr name) \
  96.     ComponentCallNow(kICCDefaultFileName,4);
  97.  
  98. /* ***** Reading and Writing Preferences ***** */
  99.  
  100. pascal ICError ICCBegin(internetConfigurationComponent inst,ICPerm perm) \
  101.     ComponentCallNow(kICCBegin,2);
  102. pascal ICError ICCGetPref(internetConfigurationComponent inst,StringPtr key,ICAttr* attr,Ptr buf,long* size) \
  103.     ComponentCallNow(kICCGetPref,16);
  104. pascal ICError ICCSetPref(internetConfigurationComponent inst,StringPtr key,ICAttr attr,Ptr buf,long size) \
  105.     ComponentCallNow(kICCSetPref,16);
  106. pascal ICError ICCFindPrefHandle(internetConfigurationComponent inst,StringPtr key,ICAttr* attr,Handle prefh) \
  107.     ComponentCallNow(kICCFindPrefHandle,12);
  108. pascal ICError ICCGetPrefHandle(internetConfigurationComponent inst,StringPtr key,ICAttr* attr,Handle* prefh) \
  109.     ComponentCallNow(kICCGetPrefHandle,12);
  110. pascal ICError ICCSetPrefHandle(internetConfigurationComponent inst,StringPtr key,ICAttr attr,Handle prefh) \
  111.     ComponentCallNow(kICCSetPrefHandle,12);
  112. pascal ICError ICCCountPref(internetConfigurationComponent inst,long* count) \
  113.     ComponentCallNow(kICCCountPref,4);
  114. pascal ICError ICCGetIndPref(internetConfigurationComponent inst,long n,StringPtr key) \
  115.     ComponentCallNow(kICCGetIndPref,8);
  116. pascal ICError ICCDeletePref(internetConfigurationComponent inst,StringPtr key) \
  117.     ComponentCallNow(kICCDeletePref,4);
  118. pascal ICError ICCEnd(internetConfigurationComponent inst) \
  119.     ComponentCallNow(kICCEnd,0);
  120. pascal ICError ICCEditPreferences(internetConfigurationComponent inst,StringPtr key) \
  121.     ComponentCallNow(kICCEditPreferences,4);
  122.  
  123. /* ***** URL Handling ***** */
  124.  
  125. pascal ICError ICCParseURL(internetConfigurationComponent inst,StringPtr hint,Ptr data,long len,long* selStart,long* selEnd,Handle url) \
  126.     ComponentCallNow(kICCParseURL,24);
  127. pascal ICError ICCLaunchURL(internetConfigurationComponent inst,StringPtr hint,Ptr data,long len,long* selStart,long* selEnd) \
  128.     ComponentCallNow(kICCLaunchURL,20);
  129.  
  130. /*
  131.     ***** Mappings Routines *****
  132.     
  133.     Routines for interrogating mappings database.
  134.     
  135.     ----- High Level Routines -----
  136. */
  137.  
  138. pascal ICError ICCMapFilename(internetConfigurationComponent inst,StringPtr filename,ICMapEntry* entry) \
  139.     ComponentCallNow(kICCMapFilename,8);
  140. pascal ICError ICCMapTypeCreator(internetConfigurationComponent inst,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry) \
  141.     ComponentCallNow(kICCMapTypeCreator,16);
  142.  
  143. /* ----- Mid Level Routines ----- */
  144.  
  145. pascal ICError ICCMapEntriesFilename(internetConfigurationComponent inst,Handle entries,StringPtr filename,ICMapEntry* entry) \
  146.     ComponentCallNow(kICCMapEntriesFilename,12);
  147. pascal ICError ICCMapEntriesTypeCreator(internetConfigurationComponent inst,Handle entries,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry) \
  148.     ComponentCallNow(kICCMapEntriesTypeCreator,20);
  149.  
  150. /* ----- Low Level Routines ----- */
  151.  
  152. pascal ICError ICCCountMapEntries(internetConfigurationComponent inst,Handle entries,long* count) \
  153.     ComponentCallNow(kICCCountMapEntries,8);
  154. pascal ICError ICCGetIndMapEntry(internetConfigurationComponent inst,Handle entries,long ndx,long* pos,ICMapEntry* entry) \
  155.     ComponentCallNow(kICCGetIndMapEntry,16);
  156. pascal ICError ICCGetMapEntry(internetConfigurationComponent inst,Handle entries,long pos,ICMapEntry* entry) \
  157.     ComponentCallNow(kICCGetMapEntry,12);
  158. pascal ICError ICCSetMapEntry(internetConfigurationComponent inst,Handle entries,long pos,ICMapEntry* entry) \
  159.     ComponentCallNow(kICCSetMapEntry,12);
  160. pascal ICError ICCDeleteMapEntry(internetConfigurationComponent inst,Handle entries,long pos) \
  161.     ComponentCallNow(kICCDeleteMapEntry,8);
  162. pascal ICError ICCAddMapEntry(internetConfigurationComponent inst,Handle entries,ICMapEntry* entry) \
  163.     ComponentCallNow(kICCAddMapEntry,8);
  164.  
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168.  
  169. #endif /* __H_IC_Component_API__ */
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.